<?php
    /* 
     * @property int $id_appointment int
     * @property int $id_creator int
     * @property string $date_create datetime
     * @property string $date_start datetime
     * @property string $date_end datetime
     * @property string $value varchar
     * @property int $id_user int
     * @property int $id_client int
     * @property string $comment text
     */
    class WZModel_Appointment extends WZ_Model_Abstract
    {
        protected $_name = 'appointment';
        protected $_primary = 'id_appointment';
        protected $_rowClass = 'WZModel_Row_Appointment';
        
        protected $_referenceMap    = array(
            'Creator' => array(
                'columns'           => array('id_creator'),
                'refTableClass'     => 'User',
                'refColumns'        => 'id_user'
            ),
            'User' => array(
                'columns'           => array('id_user'),
                'refTableClass'     => 'User',
                'refColumns'        => 'id_user'
            ),
            'Client' => array(
                'columns'           => array('id_client'),
                'refTableClass'     => 'Client',
                'refColumns'        => array('id_client')
            )
        );
    }
    
    class WZModel_Row_Appointment extends Zend_Db_Table_Row_Abstract
    {
        /**
         * Set id_appointment (int)
         *
         * @param int $value
         * @return Model_Base_Appointment
         */
        public function setIdAppointment($value)
        {
            $this->id_appointment = $value;
            return $this;
        }

        /**
         * Get id_appointment (int)
         *
         * @return int
         */
        public function getIdAppointment()
        {
            return $this->id_appointment;
        }

        /**
         * Set id_creator (int)
         *
         * @param int $value
         * @return Model_Base_Appointment
         */
        public function setIdCreator($value)
        {
            $this->id_creator = $value;
            return $this;
        }

        /**
         * Get id_creator (int)
         *
         * @return int
         */
        public function getIdCreator()
        {
            return $this->id_creator;
        }

        /**
         * Set date_create (datetime)
         *
         * @param string $value
         * @return Model_Base_Appointment
         */
        public function setDateCreate($value)
        {
            $this->date_create = $value;
            return $this;
        }

        /**
         * Get date_create (datetime)
         *
         * @return string
         */
        public function getDateCreate()
        {
            return $this->date_create;
        }

        /**
         * Set date_start (datetime)
         *
         * @param string $value
         * @return Model_Base_Appointment
         */
        public function setDateStart($value)
        {
            $this->date_start = $value;
            return $this;
        }

        /**
         * Get date_start (datetime)
         *
         * @return string
         */
        public function getDateStart()
        {
            return $this->date_start;
        }

        /**
         * Set date_end (datetime)
         *
         * @param string $value
         * @return Model_Base_Appointment
         */
        public function setDateEnd($value)
        {
            $this->date_end = $value;
            return $this;
        }

        /**
         * Get date_end (datetime)
         *
         * @return string
         */
        public function getDateEnd()
        {
            return $this->date_end;
        }

        /**
         * Set value (varchar)
         *
         * @param string $value
         * @return Model_Base_Appointment
         */
        public function setValue($value)
        {
            $this->value = $value;
            return $this;
        }

        /**
         * Get value (varchar)
         *
         * @return string
         */
        public function getValue()
        {
            return $this->value;
        }

        /**
         * Set id_user (int)
         *
         * @param int $value
         * @return Model_Base_Appointment
         */
        public function setIdUser($value)
        {
            $this->id_user = $value;
            return $this;
        }

        /**
         * Get id_user (int)
         *
         * @return int
         */
        public function getIdUser()
        {
            return $this->id_user;
        }

        /**
         * Set id_client (int)
         *
         * @param int $value
         * @return Model_Base_Appointment
         */
        public function setIdClient($value)
        {
            $this->id_client = $value;
            return $this;
        }

        /**
         * Get id_client (int)
         *
         * @return int
         */
        public function getIdClient()
        {
            return $this->id_client;
        }

        /**
         * Set comment (text)
         *
         * @param string $value
         * @return Model_Base_Appointment
         */
        public function setComment($value)
        {
            $this->comment = $value;
            return $this;
        }

        /**
         * Get comment (text)
         *
         * @return string
         */
        public function getComment()
        {
            return $this->comment;
        }
        
        public function findUser()
        {
            return $this->findParentRow('User');
        }
        
        public function findCreator()
        {
            return $this->findParentRow('Creator');
        }

        public function findClient()
        {
            return $this->findParentRow('Client');
        }
    }